<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name=”renderer” content=”webkit|ie-comp|ie-stand” />
    <title>个人信息</title>
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css">
    <script src="__PUBLIC__/js/jquery-2.1.4.min.js"></script>
    <script src="__PUBLIC__/js/bootstrap.min.js" ></script>
    <style>
        body{
            margin-top: 5px;
        }
    </style>
</head>
<body>
<div class="container col-lg-6 col-lg-push-3">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h4>个人信息</h4>
        </div>
        <ul class="list-group-item-heading">
            <h4 class="text-primary">姓名 <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </span><input type="text" id="iname" value={$user['name']}></h4>
        </ul>
        <ul class="list-group-item-heading">
            <h4 class="text-primary">学号或工号 <span>&nbsp;&nbsp;&nbsp;
            </span><input type="text" id="inum"  disabled="disabled" value={$user['cardnum']}></h4>
        </ul>
        <ul class="list-group-item-heading">
            <h4 class="text-primary">学院 <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </span><input id="idep" type="text" value={$user['department']}></h4>
        </ul>
        <ul class="list-group-item-heading">
            <h4 class="text-primary">班级专业 <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </span><input type="text" id="imaj"  value={$user['major']}></h4>
        </ul>
        <ul class="list-group-item-heading">
            <h4 class="text-primary">性别 <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </span><input id="isex" type="text" value={$user['sex']}></h4>
        </ul>
    </div>
    <div class=" container col-lg-1 col-lg-push-6">
        <button class="btn btn-success" onclick="javascript: confirm();" >保存</button>
    </div>
</div>
<script type="text/javascript">
    function confirm(){
        $.ajax({
            url: "{:U('Users/saveUsers')}",
            type: 'GET',
            dataType: 'json',
            data: {
                'name': $('#iname').val(),
                'cardnum': $('#inum').val(),
                'department': $('#idep').val(),
                'major': $('#imaj').val(),
                'sex': $('#isex').val()
            }, success: function (json) {
                if(json==true){
                    alert('修改成功');
                }else{
                    alert('修改失败，请联系技术人员');
                }
            }
        });
    }
</script>
</body>
</html>